

import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/mfee")
public class mfee extends HttpServlet {
	private static final long serialVersionUID = 1L;
    public mfee() throws ClassNotFoundException {
        super();
        Class.forName ("org.sqlite.JDBC");
    }
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		try {
			Connection conn = DriverManager.getConnection("jdbc:sqlite:cms.db");
			String roll=request.getParameter("roll");
			String name=request.getParameter("name");
			String amount=request.getParameter("amount");
			String date=request.getParameter("date");
			
			PreparedStatement preStatement = conn.prepareStatement("update scholership set amount = ? ,name = ? , due = ? where roll = ?");
		    
			preStatement.setString(1, amount);
			preStatement.setString(2, name);
			preStatement.setString(3, date);
			preStatement.setString(4, roll);
		    
			preStatement.executeUpdate();
		    
		    preStatement.close();
			conn.close();
			response.getWriter().println("update scholership for "+ roll);
		} catch (SQLException e) {
			e.printStackTrace();
		}

	}
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	}

}
